var utils = require('../../utils/utils.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  bf: function (e) {
    var work_id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../../pages/player/player?id='+ work_id,
    })
  },

  onLoad: function (options) {
    console.log(options.WorksId)
    // this.setData({
    //   performanceInfo: [{
    //     imgurl: options.url+'=5&upload_type=album&device_type=ios&name=medium&magick=png',
    //     title: options.title,
    //     author: "某某某",
    //     num1: "767.6万",
    //     num2: "257"
    //   }],
    //   imgurl: options.url+'=5&upload_type=album&device_type=ios&name=medium&magick=png',
    // });
    var that = this;
    this.setData({
      id: options.WorksId,
    })
    utils.myRequest({
      url: 'http://127.0.0.1:8000/details/' + options.WorksId +'/',
      methods: 'GET',
      success: function (res) {
        console.log(res);//打印出返回的数据
        that.setData({
          result: res.data
        })
      }
    }),
      utils.myRequest({
      url: 'http://127.0.0.1:8000/tracks/' + options.WorksId + '/',
        methods: 'PUT',
        success: function (res) {
          console.log(res);//打印出返回的数据
        }
      })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})